%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/polymorphic/vulns"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 11, 12, 16, 21, 36, 77, 106, 107, 108, 13, 15<br />2: 10, 19, 28<br />ᐳ: 61, 104, 105, 29, 32<br />3: Connection[14]<br />4: ConnectionItems[25]<br />ᐳ: 60, 62, 65, 66"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 14, 61, 77, 25, 13, 32, 62, 66<br /><br />ROOT Connectionᐸ10ᐳ[14]"):::bucket
    Bucket2("Bucket 2 (listItem)<br />Deps: 36, 13<br /><br />ROOT __Item{2}ᐸ104ᐳ[23]"):::bucket
    Bucket4("Bucket 4 (polymorphic)<br />__typename: Access[39]<br />Deps: 39, 13, 40"):::bucket
    Bucket5("Bucket 5 (polymorphicPartition)<br />|FirstPartyVulnerability<br />Deps: 13, 40<br />ᐳFirstPartyVulnerability<br /><br />1: PgSelect[41]<br />2: PgSelectRows[46]<br />ᐳ: 45, 47, 58, 63, 67"):::bucket
    Bucket6("Bucket 6 (polymorphicPartition)<br />|ThirdPartyVulnerability<br />Deps: 13, 40<br />ᐳThirdPartyVulnerability<br /><br />1: PgSelect[49]<br />2: PgSelectRows[54]<br />ᐳ: 53, 55, 59, 64, 68, 70"):::bucket
    Bucket7("Bucket 7 (listItem)<br />Deps: 61, 77, 13<br /><br />ROOT __Item{7}ᐸ25ᐳ[56]"):::bucket
    Bucket8("Bucket 8 (nullableBoundary)<br />Deps: 79, 57, 13, 81, 73<br /><br />ROOT Edge{7}[57]"):::bucket
    Bucket9("Bucket 9 (polymorphic)<br />__typename: Access[80]<br />Deps: 80, 13, 81"):::bucket
    Bucket10("Bucket 10 (polymorphicPartition)<br />|FirstPartyVulnerability<br />Deps: 13, 81<br />ᐳFirstPartyVulnerability<br /><br />1: PgSelect[82]<br />2: PgSelectRows[87]<br />ᐳ: 86, 88, 97, 99, 101"):::bucket
    Bucket11("Bucket 11 (polymorphicPartition)<br />|ThirdPartyVulnerability<br />Deps: 13, 81<br />ᐳThirdPartyVulnerability<br /><br />1: PgSelect[90]<br />2: PgSelectRows[95]<br />ᐳ: 94, 96, 98, 100, 102, 103"):::bucket
    end
    Bucket0 --> Bucket1 & Bucket2
    Bucket1 --> Bucket7
    Bucket2 --> Bucket4
    Bucket4 --> Bucket5 & Bucket6
    Bucket7 --> Bucket8
    Bucket8 --> Bucket9
    Bucket9 --> Bucket10 & Bucket11

    %% plan dependencies
    PgUnionAll10[["PgUnionAll[10∈0] ➊<br />ᐸFirstPartyVulnerability,ThirdPartyVulnerabilityᐳ<br />More deps:<br />- Object[13]<br />- Constantᐸ3ᐳ[106]<br />- Constantᐸ[Function: applyInputConstant]ᐳ[16]"]]:::plan
    Lambda15{{"Lambda[15∈0] ➊<br />ᐸparseCursorᐳ<br />More deps:<br />- Constantᐸ'WyJkNGRlODQ2NjQ3IiwiMTAiLCJUaGlyZFBhcnR5VnVsbmVyYWJpbGl0eSIᐳ[107]"}}:::plan
    Lambda15 --> PgUnionAll10
    PgUnionAll19[["PgUnionAll[19∈0] ➊<br />ᐸFirstPartyVulnerability,ThirdPartyVulnerabilityᐳ<br />More deps:<br />- Object[13]<br />- Constantᐸ3ᐳ[106]<br />- Constantᐸ1ᐳ[108]<br />- Constantᐸ[Function: applyInputConstant]ᐳ[21]"]]:::plan
    PgUnionAll28[["PgUnionAll[28∈0] ➊<br />ᐸFirstPartyVulnerability,ThirdPartyVulnerabilityᐳ<br />More deps:<br />- Object[13]<br />- Constantᐸ3ᐳ[106]<br />- Constantᐸ[Function: applyInputConstant]ᐳ[16]"]]:::plan
    Lambda15 --> PgUnionAll28
    Connection14[["Connection[14∈0] ➊<br />ᐸ10ᐳ<br />Dependents: 4<br />More deps:<br />- Constantᐸ3ᐳ[106]"]]:::plan
    PgUnionAll10 & Lambda15 --> Connection14
    Object13{{"Object[13∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ<br />Dependents: 7"}}:::plan
    Access11{{"Access[11∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access12{{"Access[12∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access11 & Access12 --> Object13
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access11
    __Value2 --> Access12
    ConnectionItems25[["ConnectionItems[25∈0] ➊<br />Dependents: 3<br />More deps:<br />- Connection[14]"]]:::plan
    First29{{"First[29∈0] ➊"}}:::plan
    Access105{{"Access[105∈0] ➊<br />ᐸ28.itemsᐳ"}}:::plan
    Access105 --> First29
    First60{{"First[60∈0] ➊<br />More deps:<br />- ConnectionItems[25]"}}:::plan
    Access61{{"Access[61∈0] ➊<br />ᐸ10.cursorDetailsᐳ<br />Dependents: 3"}}:::plan
    PgUnionAll10 --> Access61
    Last65{{"Last[65∈0] ➊<br />More deps:<br />- ConnectionItems[25]"}}:::plan
    Access104{{"Access[104∈0] ➊<br />ᐸ19.itemsᐳ"}}:::plan
    PgUnionAll19 --> Access104
    PgUnionAll28 --> Access105
    PageInfo33{{"PageInfo[33∈1] ➊<br />More deps:<br />- Connection[14]"}}:::plan
    Access69{{"Access[69∈1] ➊<br />ᐸ14.hasNextPageᐳ<br />More deps:<br />- Connection[14]"}}:::plan
    Access71{{"Access[71∈1] ➊<br />ᐸ14.hasPreviousPageᐳ<br />More deps:<br />- Connection[14]"}}:::plan
    List37{{"List[37∈2]<br />ᐸ34,35,36ᐳ<br />More deps:<br />- Constantᐸ[HIDDEN]ᐳ[36]"}}:::plan
    Access34{{"Access[34∈2]<br />ᐸ23.0ᐳ"}}:::plan
    Access35{{"Access[35∈2]<br />ᐸ23.1ᐳ"}}:::plan
    Access34 & Access35 --> List37
    __Item23[/"__Item[23∈2]<br />ᐸ104ᐳ"\]:::itemplan
    Access104 ==> __Item23
    __Item23 --> Access34
    __Item23 --> Access35
    Lambda38{{"Lambda[38∈2]<br />ᐸtoSpecifierᐳ"}}:::plan
    List37 --> Lambda38
    Access39{{"Access[39∈2]<br />ᐸ38.__typenameᐳ"}}:::plan
    Lambda38 --> Access39
    Access40{{"Access[40∈2]<br />ᐸ38.idᐳ"}}:::plan
    Lambda38 --> Access40
    PgSelect41[["PgSelect[41∈5]<br />ᐸfirst_party_vulnerabilitiesᐳ<br />ᐳFirstPartyVulnerability<br />More deps:<br />- Object[13]"]]:::plan
    Access40 --> PgSelect41
    First45{{"First[45∈5]^"}}:::plan
    PgSelectRows46[["PgSelectRows[46∈5]^"]]:::plan
    PgSelectRows46 --> First45
    PgSelect41 --> PgSelectRows46
    PgSelectSingle47{{"PgSelectSingle[47∈5]^<br />ᐸfirst_party_vulnerabilitiesᐳ"}}:::plan
    First45 --> PgSelectSingle47
    PgClassExpression58{{"PgClassExpression[58∈5]^<br />ᐸ__first_pa...ies__.”id”ᐳ"}}:::plan
    PgSelectSingle47 --> PgClassExpression58
    PgClassExpression63{{"PgClassExpression[63∈5]^<br />ᐸ__first_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression58 o--o PgClassExpression63
    PgClassExpression67{{"PgClassExpression[67∈5]^<br />ᐸ__first_pa...vss_score”ᐳ"}}:::plan
    PgClassExpression63 o--o PgClassExpression67
    PgSelect49[["PgSelect[49∈6]<br />ᐸthird_party_vulnerabilitiesᐳ<br />ᐳThirdPartyVulnerability<br />More deps:<br />- Object[13]"]]:::plan
    Access40 --> PgSelect49
    First53{{"First[53∈6]^"}}:::plan
    PgSelectRows54[["PgSelectRows[54∈6]^"]]:::plan
    PgSelectRows54 --> First53
    PgSelect49 --> PgSelectRows54
    PgSelectSingle55{{"PgSelectSingle[55∈6]^<br />ᐸthird_party_vulnerabilitiesᐳ"}}:::plan
    First53 --> PgSelectSingle55
    PgClassExpression59{{"PgClassExpression[59∈6]^<br />ᐸ__third_pa...ies__.”id”ᐳ"}}:::plan
    PgSelectSingle55 --> PgClassExpression59
    PgClassExpression64{{"PgClassExpression[64∈6]^<br />ᐸ__third_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression59 o--o PgClassExpression64
    PgClassExpression68{{"PgClassExpression[68∈6]^<br />ᐸ__third_pa...vss_score”ᐳ"}}:::plan
    PgClassExpression64 o--o PgClassExpression68
    PgClassExpression70{{"PgClassExpression[70∈6]^<br />ᐸ__third_pa...ndor_name”ᐳ"}}:::plan
    PgClassExpression68 o--o PgClassExpression70
    List78{{"List[78∈7]<br />ᐸ75,76,77ᐳ<br />More deps:<br />- Constantᐸ[HIDDEN]ᐳ[77]"}}:::plan
    Access75{{"Access[75∈7]<br />ᐸ56.0ᐳ"}}:::plan
    Access76{{"Access[76∈7]<br />ᐸ56.1ᐳ"}}:::plan
    Access75 & Access76 --> List78
    Edge57{{"Edge[57∈7]"}}:::plan
    __Item56[/"__Item[56∈7]<br />ᐸ25ᐳ<br />More deps:<br />- ConnectionItems[25]"\]:::itemplan
    PgCursor73{{"PgCursor[73∈7]<br />More deps:<br />- Access[61]"}}:::plan
    __Item56 & PgCursor73 --> Edge57
    __Item56 --> PgCursor73
    __Item56 --> Access75
    __Item56 --> Access76
    Lambda79{{"Lambda[79∈7]<br />ᐸtoSpecifierᐳ"}}:::plan
    List78 --> Lambda79
    Access81{{"Access[81∈7]<br />ᐸ79.idᐳ"}}:::plan
    Lambda79 --> Access81
    Access80{{"Access[80∈8]<br />ᐸ79.__typenameᐳ"}}:::plan
    Lambda79 --> Access80
    PgSelect82[["PgSelect[82∈10]<br />ᐸfirst_party_vulnerabilitiesᐳ<br />ᐳFirstPartyVulnerability<br />More deps:<br />- Object[13]"]]:::plan
    Access81 --> PgSelect82
    First86{{"First[86∈10]^"}}:::plan
    PgSelectRows87[["PgSelectRows[87∈10]^"]]:::plan
    PgSelectRows87 --> First86
    PgSelect82 --> PgSelectRows87
    PgSelectSingle88{{"PgSelectSingle[88∈10]^<br />ᐸfirst_party_vulnerabilitiesᐳ"}}:::plan
    First86 --> PgSelectSingle88
    PgClassExpression97{{"PgClassExpression[97∈10]^<br />ᐸ__first_pa...ies__.”id”ᐳ"}}:::plan
    PgSelectSingle88 --> PgClassExpression97
    PgClassExpression99{{"PgClassExpression[99∈10]^<br />ᐸ__first_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression97 o--o PgClassExpression99
    PgClassExpression101{{"PgClassExpression[101∈10]^<br />ᐸ__first_pa...vss_score”ᐳ"}}:::plan
    PgClassExpression99 o--o PgClassExpression101
    PgSelect90[["PgSelect[90∈11]<br />ᐸthird_party_vulnerabilitiesᐳ<br />ᐳThirdPartyVulnerability<br />More deps:<br />- Object[13]"]]:::plan
    Access81 --> PgSelect90
    First94{{"First[94∈11]^"}}:::plan
    PgSelectRows95[["PgSelectRows[95∈11]^"]]:::plan
    PgSelectRows95 --> First94
    PgSelect90 --> PgSelectRows95
    PgSelectSingle96{{"PgSelectSingle[96∈11]^<br />ᐸthird_party_vulnerabilitiesᐳ"}}:::plan
    First94 --> PgSelectSingle96
    PgClassExpression98{{"PgClassExpression[98∈11]^<br />ᐸ__third_pa...ies__.”id”ᐳ"}}:::plan
    PgSelectSingle96 --> PgClassExpression98
    PgClassExpression100{{"PgClassExpression[100∈11]^<br />ᐸ__third_pa...s__.”name”ᐳ"}}:::plan
    PgClassExpression98 o--o PgClassExpression100
    PgClassExpression102{{"PgClassExpression[102∈11]^<br />ᐸ__third_pa...vss_score”ᐳ"}}:::plan
    PgClassExpression100 o--o PgClassExpression102
    PgClassExpression103{{"PgClassExpression[103∈11]^<br />ᐸ__third_pa...ndor_name”ᐳ"}}:::plan
    PgClassExpression102 o--o PgClassExpression103

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgUnionAll10,Access11,Access12,Object13,Connection14,Lambda15,PgUnionAll19,ConnectionItems25,PgUnionAll28,First29,First60,Access61,Last65,Access104,Access105 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PageInfo33,Access69,Access71 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,__Item23,Access34,Access35,List37,Lambda38,Access39,Access40 bucket2
    classDef bucket4 stroke:#0000ff
    class Bucket4 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5,PgSelect41,First45,PgSelectRows46,PgSelectSingle47,PgClassExpression58,PgClassExpression63,PgClassExpression67 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,PgSelect49,First53,PgSelectRows54,PgSelectSingle55,PgClassExpression59,PgClassExpression64,PgClassExpression68,PgClassExpression70 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,__Item56,Edge57,PgCursor73,Access75,Access76,List78,Lambda79,Access81 bucket7
    classDef bucket8 stroke:#dda0dd
    class Bucket8,Access80 bucket8
    classDef bucket9 stroke:#ff0000
    class Bucket9 bucket9
    classDef bucket10 stroke:#ffff00
    class Bucket10,PgSelect82,First86,PgSelectRows87,PgSelectSingle88,PgClassExpression97,PgClassExpression99,PgClassExpression101 bucket10
    classDef bucket11 stroke:#00ffff
    class Bucket11,PgSelect90,First94,PgSelectRows95,PgSelectSingle96,PgClassExpression98,PgClassExpression100,PgClassExpression102,PgClassExpression103 bucket11

